/*
 *  DBConnection.h
 *  ObjectivePQ
 *
 *  Created by Ian and Sadie Michell on 31/01/2009.
 *  Copyright 2009 Ian Michell. All rights reserved.
 *
 */
#import "DBStatement.h"
#import "DBPreparedStatement.h"

@protocol DBConnection
//==============================================================================
// Constructor Methods
//==============================================================================

- (id <DBConnection>) init;
- (id <DBConnection>) initWithConnectionString: (NSString*) connStr;
/** Connect to the database server */
- (void) connect;
- (void) connectWithConnectionString: (NSString*) connStr;

//==============================================================================
// Statements
//
- (id <DBStatement>) createStatement;
- (id <DBPreparedStatement>) prepareStatement;
- (id <DBStatement>) createStatementWithQuery: (NSString*) query;
- (id <DBPreparedStatement>) prepareStatementWithQuery: (NSString*) query;

//==============================================================================
// Connection Methods
//==============================================================================

/** Sets the connection string */
- (void) setConnectionString: (NSString *) connStr;

/** Is the connection active? */
- (bool) isConnected;
/** Reset a communication channel to the server */
- (void) reset;
/** Closes a connection to the server */
- (void) close;

@end
